namespace Belmost4PDA.Constants
{
    public class SQLControlsReader
    {
        public const string SelectParamsView = "select idSheetInterfaceLite as idSheetInterface, idOwnSheet, sheetName, idTopControl, qryText, orderBy as tableName, 0 as hasGrid from SheetInterfaceLite";
        public const string SelectBoolValById = "select idCheckingFlag, Text as Value from CheckingFlags where idCheckingFlag={0}";
        public const string SelectGridMainParam = "select * from ControlInterface where idOwnControl = {0} and idControlType = " + ControlType.GridGroup;
        public const string SelectInterfaceByParent = "select * from ControlInterface where idOwnControl = {0}";
        public const string SelectInterfaceByParentNotGrid = "select DISTINCT a.idControlInterface, a.idOwnControl, a.idControlType, a.fieldName, a.controlName, a.controlLenght, a.controlLinesCount, a.checkTrue, a.checkFalse,  a.idQryList, a.valType, a.minVal, a.maxVal, b.CHARACTER_MAXIMUM_LENGTH AS Length, b.numeric_precision AS numallLength,  b.numeric_scale AS numFraction FROM ControlInterface a LEFT OUTER JOIN Information_schema.columns b ON a.fieldName = b.Column_name where a.idOwnControl = {0} and a.idControlType <> " + ControlType.GridGroup;
        public const string SelectQueryById = "select * from QryList where idQryList={0}";
        public const string SelectParamsEdit = "select a.*, b.needExport as NEEDEXPORT from SheetInterface a left outer join Transfer2PDA b on a.tablename=b.tablename";
        public const string SelectCharacterLenght = "SELECT CHARACTER_MAXIMUM_LENGTH, Column_name FROM Information_schema.columns";
    }
}
